Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Unanswered

Find leading words in a string in a calculated field in a Dataverse table

(0) ShareShare
ReportReport
Posted on by 26

I need to check book titles to determine whether they start with "The " or "A ".

It seems impossible. I can find "The" and "A", but that includes other words, such as "Theory" or "Access", which I don't want. 

Is it possible to use TrimLeft to find "The " or "A "? If not, what workarounds are available.

 

This will result in a sortable field that doesn't put all of the titles that start with "A " at the top and "The " together in latter part of the list. 

 

 

Categories:
  • gpgeorge Profile Picture
    gpgeorge 26 on at
    Re: Find leading words in a string in a calculated field in a Dataverse table

    Thank you, I was resigned to a work-around. I will try this and report back on how it works out.

  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Find leading words in a string in a calculated field in a Dataverse table

    @gpgeorge, Okey, a work around will be using a Power Automate Flow that is triggered when Dataverse record is Added, Modified, and use this expression to update the value of a Text Column in your table:

     

    Or(startsWith(variables('varString'),'The '),startsWith(variables('varString'),'A '))

     

    Note, the result of this formula is true or false. If it starts with "The " or "A ", it will give you true, else it will give you false.

     

     

    Regards,
    Ahmed
    If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accept it as the Solution to help other members in the community find it more.

  • gpgeorge Profile Picture
    gpgeorge 26 on at
    Re: Find leading words in a string in a calculated field in a Dataverse table

    This is what I can see in the Calculated Field editor. 

    gpgeorge_0-1656693557344.png

    Note that if I try to include a trailing space after The, I either get a syntax error or it is trimmed off. 

    gpgeorge_1-1656693710274.png

     

  • gpgeorge Profile Picture
    gpgeorge 26 on at
    Re: Find leading words in a string in a calculated field in a Dataverse table

    I didn't see that option. I'll look again, though, thanks.

     

    The option I did see in the calculated field editor was "BeginsWith", which doesn't accept the trailing spaces.

  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Find leading words in a string in a calculated field in a Dataverse table

    @gpgeorge, are you using the StartsWith( Text, StartText )?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard

Featured topics