1

I receive input data like that into a web service developed using a Genexus Procedure: SmsMessageSid=SM7e1ab417617176ec9936788235aaf020&NumMedia=0&ProfileName=Checho&SmsSid=SM7e1ab417617176ec9936788235aaf045&WaId=5699999999&SmsStatus=received&Body=**Este+es+un+texto+lago+que+incluye+%3A+%25+.+%F0%9F%99%82+%28emoji%29**&To=whatsapp%3A%2B189898886&NumSegments=1&ReferralNumMedia=0&MessageSid=SM7e1ab417617176ec9936788235aaf020&AccountSid=ACfda172076a87805952e99b3be82007d9&From=whatsapp%3A%2B56975495288&ApiVersion=2010-04-01

I need access to Body parameter, but it has url format. It's necessary to convert body's value to a clear text.

Regards!

Genexus has URLEncode function, but it's necessary the reverse function. Genexus functions

3 Answers3

1

I would use a regular expression to search the url

&pattern = '&Body=\w*&' //CHECK THIS!!
&rslt = &url.Matches(&pattern)

Check the documentation of regular expressions with genexus and adapt the pattern that you have to look for. https://wiki.genexus.com/commwiki/servlet/wiki?4606,Regular+Expressions+%28RegEx%29

ealmeida
  • 444
  • 3
  • 11
  • I think it's useful for find Body variable. However, I need to convert value of Body variable in decoded URI. On the other hand, Genexus provides URLEncode but it doesn't exist in Genexus functions. – Sergio Sepúlveda Montealegre Nov 18 '22 at 00:37
0

To decode the URL I would recommend the use of native code.

For example: How to do URL decoding in Java?

Federico Alvarez
  • 1,459
  • 1
  • 19
  • 30
0

You can do it by writing native code and using GxClasses methods:

JAVA [!&decodedUrl!] = GXutil.URLDecode([!&url!]);

CSHARP [!&decodedUrl!] = GXUtil.UrlDecode([!&url!]);
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103