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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,904)