cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
langsem
Post Patron
Post Patron

Check if string its empty

Hello I have a barcode scanner that scans a qr code. Then it extracts some values. 

I then have a label that holds the value. I want to make a function that says "If the field its empty assign variable1 if the fields its not empty do First(Match(BarcodeScanner1.Value;"FORSIKRING:(.+)";Contains).SubMatches).Value)

How can i perform this ? I tried with If(IsBlank(Label2.Text);"variable1";First(Match(BarcodeScanner1.Value;"FORSIKRING:(.+)";Contains).SubMatches).Value)

 

But it gives error

12 REPLIES 12

Hmm its close, but only god "variable1" each time now :S

v-xiaochen-msft
Community Support
Community Support

Hi @langsem ,

 

You could try this code:

If(IsBlank(Trim(First(Match(BarcodeScanner1.Value;"FORSIKRING:(.+)";Contains).SubMatches).Value))),"variable 1",First(Match(BarcodeScanner1.Value;"FORSIKRING:(.+)";Contains).SubMatches).Value))

// Trim function can delete all spaces in a text string, except for a single space between words.

 

Best Regards,

Wearsky

THank you so much for help !! YOu rock!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,682)