cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Flow condition with SharePoint hyperlink field

I'm hoping there's a simple explanation for this, but couldn't find any references to it via Google ...
I'm using Power Automate to manage a link in my SharePoint Calendar events. The first step works fine, because my Flow condition is, "If the Hyperlink field equals null, write a 'Book this event' hyperlink to the Register field".
Once the event is fully booked, the admin person sets the event category to "Booked" and the Flow runs again, to see if the Category equals Booked (it does) and the Register field does not contain the text "already" (it doesn't).
But after that second run, the Condition should return a negative (because the Hyperlink contains "already" and the Flow should follow the No path and stop.

But I'm getting a looping Flow ... so I'm guessing that the Flow is seeing my second condition as Yes, when logically it should be No ...
Here's the second Condition and the Send an HTTP Request to SharePoint function ...

AlanMcK_0-1675860029379.png

 

What have I done wrong?



3 ACCEPTED SOLUTIONS

Accepted Solutions
Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @AlanMcK,

 

Thanks for clarifying.

 

I assume you are talking about the alternative text (aka Description) part of the Register field you are after/you want to check in the condition?

 

alternativetext.png

 

 

It seems that in most of the default SharePoint actions (I checked When a new item is created and the Get Item action) only the link of the hyperlink field value is returned, not the alternative text. So, that might explain why it cannot find the Already text in the second loop.

 

Below example is an outputs of a When an new item is created trigger action. As you can see only the url is returned, not the alternative text.

alternativetext_missing.png

 

 

A workaround could be to use a Send an HTTP request action. This action would be able to retrieve that alternative text.

 

Below is an example of that workaround

 

1. The Send an HTTP request action reuses the ID of the trigger action and uses a $select to only retrieve the Register field value.

 

register_restapi.png

 

 

2. The response would look like below. As you can see the alternative text (Description) is part of the returned value.

 

descriptionhyperlinkfield.png

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @AlanMcK,

 

Can you try this expression in your condition:

 

outputs('Send_an_HTTP_request_to_SharePoint_-_Register_value')?['body']['Register']['Description']

 

 

doesnotcontain_expression.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @AlanMcK,

 

The whole body is an object. When you refer to the description property you will get the string value back. 

 

As far as I am aware a contains works with String, Array, or Dictionary.

 

If you would convert the whole body to a string (which I wouldn't recommend, I would stick to using the description field) the contains with the body field should also work

string(outputs('Send_an_HTTP_request_to_SharePoint_-_Register_value')?['body'])

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

8 REPLIES 8
Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @AlanMcK,

 

Just to double check.

 

What data type is the Register field/column? I see you mentioned tick, which suggest it might be a yes/no type of field?

 

checkbox_orchoice.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


No, not a tickbox ... a hyperlink field. What I meant was "Category = Booked (corrrect), Register field does not contain the text 'already' (correct)" ... I'll amend the OP to reflect that.

Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @AlanMcK,

 

Thanks for clarifying.

 

I assume you are talking about the alternative text (aka Description) part of the Register field you are after/you want to check in the condition?

 

alternativetext.png

 

 

It seems that in most of the default SharePoint actions (I checked When a new item is created and the Get Item action) only the link of the hyperlink field value is returned, not the alternative text. So, that might explain why it cannot find the Already text in the second loop.

 

Below example is an outputs of a When an new item is created trigger action. As you can see only the url is returned, not the alternative text.

alternativetext_missing.png

 

 

A workaround could be to use a Send an HTTP request action. This action would be able to retrieve that alternative text.

 

Below is an example of that workaround

 

1. The Send an HTTP request action reuses the ID of the trigger action and uses a $select to only retrieve the Register field value.

 

register_restapi.png

 

 

2. The response would look like below. As you can see the alternative text (Description) is part of the returned value.

 

descriptionhyperlinkfield.png

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Thanks, Expiscornovus ...

 

I suspected that the Condition function was only looking at the URL section of the SharePoint Hyperlink column value. I tested it using the URL value as the condition item and was able to stop the looping.

Your solution looks like a good one. I'll give it a test to make sure it works in my scenario, then I'll "Accept as Solution".

Regards,
Alan

Hello, Expiscornovus ...

 

So, I've done some testing around your solution ... and it kind of almost worked in my environment (though there are a couple of small differences between what you did above and what I did ...) but in the interests of completeness, I'm documenting it here in case someone else runs into the glitch I did.

 

So I put in a Send HTTP to SharePoint function and set it up (almost) as you suggested:
pic01_Send HTTP to SharePoint.JPG
Then I used the Body output from the Send HTTP function as the source value for my condition ...

pic02_RegisterLinkCondition.JPG

Just to clarify, the Body value is:
   body('Send_an_HTTP_Request_to_SharePoint_-_Register_Value')

... so we're clear I wasn't using the wrong Body output.

Then, just to check what was going on behind the scenes, I dropped in a Compose function to display the current value of Body.

pic03_MonitorViaCompose.JPG

Then I made a change in the source List in order to trigger the Flow, then took a look at the result ...

The Compose function showed that the value for Body did indeed contain the text "already":

pic04_MonitorViaCompose.JPG

So this should have been a false from the Condition (The Register value does contain "already") and the Flow should have stopped. But not the case. The Condition outcome was true ... 

pic05_ConditionOutcome.JPG

... the Flow changed the Register value and we were in a loop again.

pic06_UpdatesAgainViaSend HTTP to SharePoint.JPG

It seemed to me like the Condition didn't much like the Body output from the initial Send HTTP...Register function.

So on a hunch, I wrote the Body value to a variable and used that. And it worked.

pic07_Variable to Hold Send HTTP to SharePoint.JPG

With the variable initialised and a default value added, I replaced the Body value in the Condition with the variable.

pic08_RegisterLinkCondition.JPG

Then I changed the Compose outcome to show the value of the variable.

pic09_MonitorViaCompose.JPG

... and triggered the Flow again. This time the Condition showed false ...

pic10_ConditionOutcome.JPG

... and the second Send HTTP to SharePoint function did not update the already updated link ... and no looping.

pic11_DoesntUpdateViaSend HTTP to SharePoint.JPG

... even though the Compose output of the variable didn't look any different from the Compose output for the Body value. 

pic12_MonitorViaCompose.JPG

So ... not quite sure what is going on here, but writing the Body value to a variable and using the variable in the Condition seemed to work where using the Body value directly in the Condition didn't appear to work.

 

Maybe I'm missing something obvious, but the result is what counts and at least I no longer have a loop when I update my Register link value from "Book this event" to "This event is already booked".

Thanks for pointing me in the right direction, though.

 

Alan.

Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @AlanMcK,

 

Can you try this expression in your condition:

 

outputs('Send_an_HTTP_request_to_SharePoint_-_Register_value')?['body']['Register']['Description']

 

 

doesnotcontain_expression.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Hi, Expiscornovus ...

 

I gave that a try ... I used the expression you give above as the Value in the Condition function  (I also added it to my Compose function so I could see what was being returned by the expression) and it seems to work just fine. Here's the Value that was captured by the Compose Expression:

pic16_Try a different expression in Compose.JPG

So I can see that the expression is capturing only the Description Text ...

I wonder why just using the raw Output from the Send HTTP to SharePoint function wasn't working?

 

Anyway, thanks for your help. I very much appreciate it ...

Regards,
Alan

Expiscornovus
Most Valuable Professional
Most Valuable Professional

Hi @AlanMcK,

 

The whole body is an object. When you refer to the description property you will get the string value back. 

 

As far as I am aware a contains works with String, Array, or Dictionary.

 

If you would convert the whole body to a string (which I wouldn't recommend, I would stick to using the description field) the contains with the body field should also work

string(outputs('Send_an_HTTP_request_to_SharePoint_-_Register_value')?['body'])

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #MicrosoftCopilotStudio content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Results posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (2,763)