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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

patch function

(0) ShareShare
ReportReport
Posted on by 15

Greetings all,

 

New to powerapps here, havent been able to figure this one out, hope somebody can help or point me in the right direction, thank you.

 

I have this app...

 

app.jpg

This "header" table..

header.JPG

And this "subheader" table...

subheader_table.jpg

Is it possible to make a patch function that first checks if any subheaders is created on the choosen "headerId" (ddChooseHeaderForSubheader), if not, create it, gets the first "sorting" number as ("headerId" + 0.01)  and the next created subheaders on the same headerid gets (last created subheader on choosen headerId + 0.01) in the table subheader "sorting" column ? 

 

 

Kind regards,

Rado

 

 

Categories:
  • Verified answer
    Rado1 Profile Picture
    15 on at

    Solution 

     

    Patch(
    SubHeader,
    {
    Sorting: If(CountRows(Filter(SubHeader,HeaderId = ddChooseHeaderForSubheader_18.Selected.DWID_Header)) > 0,
    First(FirstN(Sort(Filter(SubHeader, HeaderId=ddChooseHeaderForSubheader_18.Selected.DWID_Header),Sorting,Descending),1)).Sorting + 0.01,
    ddChooseHeaderForSubheader_18.Selected.DWID_Header + 0.01)

    })

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard