cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sjcitpro
Helper III
Helper III

Combining SortbyColumns and First

Non working formula:

UpdateIf(varCandidates,ID in Split(First(SortByColumns('Staffing List'),"Title",Ascending).CandidateIDs,"-"),{ProjectLinked:1}))

 

I am trying to retrieve the first record of a list ('Staffing List') sorted by Title then update varCandidates.ProjectLinked:1  if varCandidates.ID in 'Staffing List'.CandidateIDs

 

Example of 'Staffing List'.CandidateIDs is "10-43-40-"

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @sjcitpro ,

Based on the formula that you mentioned, I think there is something wrong with the SortByColumns() function in your UpdateIf() function.

I have made a test on my side, please take a try to modify your formula as below:

UpdateIf(
varCandidates,
ID in Split(First(SortByColumns('Staffing List',"Title", Ascending)).CandidateIDs, "-"),
{ProjectLinked:1}
)

Or

UpdateIf(
         varCandidates,
         ID in Split(First(SortByColumns('Staffing List',"Title", Ascending)).CandidateIDs, "-").Result,
         {ProjectLinked:1}
        )

Please take a try with above solution, then check if the issue is solved.

 

More details about the SortByColumns function in PowerApps, please check the following article:

SortByColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
HadynM
Kudo Kingpin
Kudo Kingpin

Hi @sjcitpro 

It looks like you have a closing bracket in the wrong place for you SortByColumns function.  Try:

UpdateIf(varCandidates,ID in Split(First(SortByColumns('Staffing List',"Title",Ascending)).CandidateIDs,"-"),{ProjectLinked:1})

Cheers Hadyn

v-xida-msft
Community Support
Community Support

Hi @sjcitpro ,

Based on the formula that you mentioned, I think there is something wrong with the SortByColumns() function in your UpdateIf() function.

I have made a test on my side, please take a try to modify your formula as below:

UpdateIf(
varCandidates,
ID in Split(First(SortByColumns('Staffing List',"Title", Ascending)).CandidateIDs, "-"),
{ProjectLinked:1}
)

Or

UpdateIf(
         varCandidates,
         ID in Split(First(SortByColumns('Staffing List',"Title", Ascending)).CandidateIDs, "-").Result,
         {ProjectLinked:1}
        )

Please take a try with above solution, then check if the issue is solved.

 

More details about the SortByColumns function in PowerApps, please check the following article:

SortByColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,646)