web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Flow condition with SharePoint hyperlink field

(0) ShareShare
ReportReport
Posted on by 68

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?



I have the same question (0)
  • Expiscornovus Profile Picture
    32,857 Most Valuable Professional on at
    Re: Flow condition with SharePoint hyperlink field

    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

  • AlanMcK Profile Picture
    68 on at
    Re: Flow condition with SharePoint hyperlink field

    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.

  • Verified answer
    Expiscornovus Profile Picture
    32,857 Most Valuable Professional on at
    Re: Flow condition with SharePoint hyperlink field

    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

     

  • AlanMcK Profile Picture
    68 on at
    Re: Flow condition with SharePoint hyperlink field

    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

  • AlanMcK Profile Picture
    68 on at
    Re: Flow condition with SharePoint hyperlink field

    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.

  • Verified answer
    Expiscornovus Profile Picture
    32,857 Most Valuable Professional on at
    Re: Flow condition with SharePoint hyperlink field

    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

  • AlanMcK Profile Picture
    68 on at
    Re: Flow condition with SharePoint hyperlink field

    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

  • Verified answer
    Expiscornovus Profile Picture
    32,857 Most Valuable Professional on at
    Re: Flow condition with SharePoint hyperlink field

    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'])

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard