cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fouad
Helper II
Helper II

True/False to Text in Flow

Hello Community,

 

I'm trying to send a mail in Flow gathering information from my SharePoint list whenever a form has been submitted. However when I try to gather information from a Yes/No column it shows as true or false. I want to have this text changed and I have tried various Expressions without any luck. I found a topic where someone asked the same question, however he wanted it when true show none and when false that it creates a custom text.

 

if(triggerBody()?['ColumnName'],null, 'Change wire')

I simply want to change my YES/NO column to the text YES/NO instead of true or false.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Hey @Fouad 

 

Try using this expression now

 

if(empty(string(body('Get_item')?['Klantgegevens'])),null,if(equals(body('Get_item')?['Klantgegevens'],true),'Yes','No'))

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

View solution in original post

14 REPLIES 14

Hey @Fouad 

 

Can you share a screenshot of the flow? note that True/false are the actual values for yes/no (yes and no are basically labels). therefore to check that in flow, you need to check with true/ false (boolean values). 

 

The expression you shared is a bit incomplete. are you trrying to check if the trigger body column name is null? if so you need to add teh equals expression too. 

 

if(equals(triggerBody()?['ColumnName'],null),value iftrue, valueiffalse)

 

If you can share more details, we might better assist you with this. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Additional information:

 

- Connected to SharePoint list


SCR3.PNG

 

- This SharePoint column is Yes/No type of column

- When I run this 'Send an email' Flow it shows me either - False if I selected 'No' in my Form and True if I selected 'Yes' in my FormScr2.PNG

Scr1.PNG

 

Hey @Fouad 

 

for Yes/No column type of true/false boolean values, you can use this expression on a variable: 

Initialise a variable and in the expression :

if(empty(triggerBody()?['ColumnName']),null,if(equals(triggerBody()?['ColumnName'],'true'),'Yes','No'))

This will change the value to Yes if the boolean is true. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Unfortunately this did not help me.. when I select 'Yes' for boolean it gives me true (just like how it did before) - Column name is: Klantgegevens

SCR4.PNG

SCR5.PNG

This is what it says in mail

 

This is where I placed the variable in HTML body.SCR6.PNG

 

Hey @Fouad 

 

can you try removing the single quotes from true and try running the flow again?

if(empty(triggerBody()?['Klantgegevens']),null,if(equals(triggerBody()?['Klantgegevens'],true),'Yes','No'))
Didn't work 😕

Hey @Fouad 

 

It is not working because you are referring to the wrong field. Which action is returnign the yes/no type field? 

 

I tested with a get items action and in the apply to each I am sending some stuff so based on that the expression is: 

if(empty(string(items('Apply_to_each')?['TaskStatus'])),null,if(equals(items('Apply_to_each')?['TaskStatus'],true),'Yes','No'))

Here, taskstatus is the column name and is of type yes/no and the apply to each is iterating over each item from the get items. 

 

if you are doing it on the get item action, replace the reference to the field accordingly. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

What am I doing wrong here 😕SCR7.PNG

 

Hey @Fouad 

 

You are initializing the wrong type of variable at the wrong place. Basically you won't need to set a variable for this. If you can share some details on the scenario that you are building, I might be able to assist you better with this

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

I'll try to explain my builded Flow in pictures, the last 2 Flows 'Send an email' has almost the same body.SCR8.PNG

 

SCR8.PNG

 

scr9.PNG

 

SCR10.PNG

 

Hopefully you can help me this way better..

 

 

Hey @Fouad 

 

Try using this expression now

 

if(empty(string(body('Get_item')?['Klantgegevens'])),null,if(equals(body('Get_item')?['Klantgegevens'],true),'Yes','No'))

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

This worked for me thanks!!

 

How do I make the same expression but then when the attachment has been added to the SharePoint list?

Hey @Fouad 

 

Can you share more details? Note that while creating expressions, if you want to use the dynamic content in the expression, try writing the expression and selecting the dynamic content within the expression to avoid any errors over there. Yuo can also initialize some variables and assign the values to that variables and use them in expressions initially for a better understanding. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

Thanks. I got it right by the following code:

if(empty(string(body('Get_item')?['{HasAttachments}'])),null,if(equals(body('Get_item')?['{HasAttachments}'],true),'Yes','No'))

Helpful resources

Announcements

Power Platform Connections - Episode 7 | March 30, 2023

Episode Seven of Power Platform Connections sees David Warner and Hugo Bernier talk to Dian Taylor, alongside the latest news, product reviews, and community blogs.     Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show.  

Announcing | Super Users - 2023 Season 1

Super Users – 2023 Season 1    We are excited to kick off the Power Users Super User Program for 2023 - Season 1.  The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.      Super User Season 1 | Contributions July 1, 2022 – December 31, 2022  Super User Season 2 | Contributions January 1, 2023 – June 30, 2023    Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.  Power Apps  Power Automate  Power Virtual Agents  Power Pages  Pstork1*  Pstork1*  Pstork1*  OliverRodrigues  BCBuizer  Expiscornovus*  Expiscornovus*  ragavanrajan  AhmedSalih  grantjenkins  renatoromao    Mira_Ghaly*  Mira_Ghaly*      Sundeep_Malik*  Sundeep_Malik*      SudeepGhatakNZ*  SudeepGhatakNZ*      StretchFredrik*  StretchFredrik*      365-Assist*  365-Assist*      cha_cha  ekarim2020      timl  Hardesh15      iAm_ManCat  annajhaveri      SebS  Rhiassuring      LaurensM  abm      TheRobRush  Ankesh_49      WiZey  lbendlin      Nogueira1306  Kaif_Siddique      victorcp  RobElliott      dpoggemann  srduval      SBax  CFernandes      Roverandom  schwibach      Akser  CraigStewart      PowerRanger  MichaelAnnis      subsguts  David_MA      EricRegnier  edgonzales      zmansuri  GeorgiosG      ChrisPiasecki  ryule      AmDev  fchopo      phipps0218  tom_riha      theapurva  takolota     Akash17  momlo     BCLS776  Shuvam-rpa     rampprakash  ScottShearer     Rusk  ChristianAbata     cchannon  Koen5     a33ik  Heartholme     AaronKnox  okeks      Matren   David_MA     Alex_10        Jeff_Thorpe        poweractivate        Ramole        DianaBirkelbach        DavidZoon        AJ_Z        PriyankaGeethik        BrianS        StalinPonnusamy        HamidBee        CNT        Anonymous_Hippo        Anchov        KeithAtherton        alaabitar        Tolu_Victor        KRider        sperry1625        IPC_ahaas      zuurg    rubin_boer   cwebb365   Dorrinda   G1124   Gabibalaban   Manan-Malhotra   jcfDaniel   WarrenBelz   Waegemma   drrickryp   GuidoPreite    If an * is at the end of a user's name this means they are a Multi Super User, in more than one community. Please note this is not the final list, as we are pending a few acceptances.  Once they are received the list will be updated. 

Register now for the Business Applications Launch Event | Tuesday, April 4, 2023

Join us for an in-depth look into the latest updates across Microsoft Dynamics 365 and Microsoft Power Platform that are helping businesses overcome their biggest challenges today.   Find out about new features, capabilities, and best practices for connecting data to deliver exceptional customer experiences, collaborating, and creating using AI-powered capabilities, driving productivity with automation—and building towards future growth with today’s leading technology.   Microsoft leaders and experts will guide you through the full 2023 release wave 1 and how these advancements will help you: Expand visibility, reduce time, and enhance creativity in your departments and teams with unified, AI-powered capabilities.Empower your employees to focus on revenue-generating tasks while automating repetitive tasks.Connect people, data, and processes across your organization with modern collaboration tools.Innovate without limits using the latest in low-code development, including new GPT-powered capabilities.    Click Here to Register Today!    

Check out the new Power Platform Communities Front Door Experience!

We are excited to share the ‘Power Platform Communities Front Door’ experience with you!   Front Door brings together content from all the Power Platform communities into a single place for our community members, customers and low-code, no-code enthusiasts to learn, share and engage with peers, advocates, community program managers and our product team members. There are a host of features and new capabilities now available on Power Platform Communities Front Door to make content more discoverable for all power product community users which includes ForumsUser GroupsEventsCommunity highlightsCommunity by numbersLinks to all communities Users can see top discussions from across all the Power Platform communities and easily navigate to the latest or trending posts for further interaction. Additionally, they can filter to individual products as well.   Users can filter and browse the user group events from all power platform products with feature parity to existing community user group experience and added filtering capabilities.     Users can now explore user groups on the Power Platform Front Door landing page with capability to view all products in Power Platform.      Explore Power Platform Communities Front Door today. Visit Power Platform Community Front door to easily navigate to the different product communities, view a roll up of user groups, events and forums.

Microsoft Power Platform Conference | Registration Open | Oct. 3-5 2023

We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5 2023! But first, let's take a look back at some fun moments and the best community in tech from MPPC 2022 in Orlando, Florida.   Featuring guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, Stephen Siciliano, Hugo Bernier and many more.   Register today: https://www.powerplatformconf.com/   

Users online (4,432)