I am trying to create a snippet that reads specific information from another website and returns it.
I think using extractregx is the best way to do this, but I am getting an error No Match Found.
The website does have drop downs when viewing, where you have to select show all, maybe that is the issue, because the info is inside that show all view.
Let's start one step at a time. Unfortunately, I can't verify whether this will work as the website is behind a login and I can't access that data. This might actually be an issue for you too (@scott - can you confirm please?).
First off, I noticed a mistake in your regex syntax, so I've fixed it below. Additionally, I changed the multiple \d and \w to \d+ and \w+, which is basically telling the command to keep matching digits/word characters until they run out.
Can you test this please?
{urlload: https://xyz.co/index/payment#/query/PBhUZMBTumlTxQI1Ga0C7qQuvaB; done=res -> ["Transaction_ID" =extractregex(res, "\d+"), "Auth_Code"=extractregex(res, "\d+"), "Last_Debit"=extractregex(res, "\d+\w+\d+")]}
Transaction ID {=Transaction_ID}
Authorization Code: {=Auth_Code}
Last 4 of Card Number: {=Last_Debit}
Best way to be able to create a solution for you, is if you could provide me with some dummy text to test the regex on. Please make sure there's no private information, since this is a public forum.
Hey Cedric! Thanks for your help. I'm a teammate of Danielle. If we wanted to use the regex on some JSON data, how would we go about doing that? Adding some dummy JSON below:
{
"Transaction_ID":"1234567890123456",
"Auth_Code":"123456",
"Last_Debit":"0000"
}
Thanks Scott! I'm continuing to dig into this more and I'm finding out that this could get a bit more complex since there's a layer of XML on top of the JSON. My thoughts are to use the {site} function to load in the XML and then use the fromJSON function to pull the data underneath the XML. Think I'm taking a good approach here? It's using Angular as a framework so it's a bit more complex than we first anticipated.