108
Views
5
Comments
I had a text data in a field and i want to filled two input field from the text.

I had a text data in a field and i want to filled two input field from that text. Like there is text field in which there is text like my mobile number, name, etc. and now I want to search name from the text and field that name in the name input field. How Can I achieve this?


Warm Regards,

Kapil

2022-08-03 04-32-50
Ravi Punjwani

Hi Kapil,

I personally felt it difficult to understand your question. Can you break your long sentence into small sentences and provide a screenshot, sketch etc. for better understanding?

Thanks

UserImage.jpg
Kapil Joshi

In below diagram there is a text filled in first box and so I want to extract aadhar number from first box to next box. I hope you got it now @Ravi Punjwani 

2022-08-03 04-32-50
Ravi Punjwani

This seems only a matter of adding appropriate logic as you would do in C# or any other programming language.

First of all split the whole text with the new line separator. Then from the items you get it from splitting, trim each of them with spaces and tabs on both ends. For this step, use String_Split action from Text module.

At this stage, you should be able to find out if "Aadhar" text exists in the given string or not. Loop through all the strings you got from previous step of splitting new line and trimming spaces. Check each of them if the string has "Aadhar" text or not. If yes, that one is your string to consider.

Remove "Aadhar" "Card" "Number" ":" "<space>", "<tab>" etc. This way you removed the unwanted characters from that string, the remaining part is your ultimate aadhar card number. Return the card number.

It would be better to put all this logic in a separate server action away from your screen actions, to keep it specifically for this purpose for helping code readability. Returned aadhar card number can be used to build your new string "Aadhar number:" + {Aadhar_number_output}

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi Kapil,

the short answer to that would be : don't do it.  If there are 2 different pieces of information, don't ever mix them into one single variable/field, as you are then facing the problem of splitting them up later.

If you are stuck with this type of information coming from an external source, you'll have to get a very good understanding first of the exact formatting of this, such as when somebody has multiple names, when name is absent or phone number is absent, exact format of phone number, spaces, country codes,....

Once you know all that, you can build parsing software on your end, using things like substr, split, etc.

Dorine

UserImage.jpg
Kapil Joshi

Hi @Dorine Boudry

I will try it.


Thanks,


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.