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 Platform Community / Forums / Power Apps / Patch Function - Don't...
Power Apps
Answered

Patch Function - Don't Record if an input is blank

(0) ShareShare
ReportReport
Posted on by 31

Thanks to this forum I've made great progress on my app (thank you!)  To help fine tune, I'm hoping to reduce the amount of "noise" created in my SharePoint list when there is a submission. 

 

The app is currently setup as a Gallery with 6 "inputs". Once a date is selected, that date is automatically populated to all 6 fields within each "input". However, some of my colleagues may not need all 6 "inputs" when submitting their time. Is it possible to only have the Patch Function add a row of data when let's say the "ClientDD_1" has a value?  Below is the current formula that is successfully passing all 6 records to my SharePoint list:

 

ForAll(
Gallery1.AllItems,
Patch('Time Entries v1', Defaults('Time Entries v1'),
{WeekEnding: WeekEnding_1.Text, TimeWorked: TimeWorked_1.Text, WeekNotes: Notes1_1.Text, Client: ClientDD_1.SelectedText.Value, Category: CategoryDD_1.SelectedText.Value}))
;
Navigate(Confirmation,None)

 

Thank you in advance!

FireShot Pro Webpage Screenshot #534 - 'Power Apps' - make.powerapps.com.png
Categories:
I have the same question (0)
  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    Try adding an IF() that only patches when ClientDD_1 has a value.

     

    ForAll(
    Gallery1.AllItems,
    If(!IsBlank(ClientDD_1.SelectedText.Value),
    Patch('Time Entries v1', Defaults('Time Entries v1'),
    {WeekEnding: WeekEnding_1.Text, TimeWorked: TimeWorked_1.Text, WeekNotes: Notes1_1.Text, Client: ClientDD_1.SelectedText.Value, Category: CategoryDD_1.SelectedText.Value})))
    ;
    Navigate(Confirmation,None)

     

  • Sidhant_02 Profile Picture
    986 on at

    Hi @Jeff_Thorpe , @gengeset ,
    I had a similar kind of requirement wherein I had some data stored in my SharePoint list (wherein initially I am trying to save the data related to Qualifications)

    Sidhant_02_0-1702362026548.png

    So as you can see (EmployeeId: 14567 has 2 qualifications associated with them and EId: 2315 has only 1 qualification record) so in the final submit only three rows should be saved as the last row (4th row has no value/empty Qualification, Institute name for employeeId: 2315)
    So I used the following expression to check if any field is not blank

    ForAll(RegisterationData,
    If(!IsBlank(ThisRecord.InstituteName || ThisRecord.Qualification),
    Patch(Employee_Qualifications,
    Defaults(Employee_Qualifications),
    
    {
     Institutename: ThisRecord.InstituteName,
     Qualificationtitle:ThisRecord.Qualification,
     EmployeeId:ThisRecord.EmployeeID
    }
    )
    )
    );

    But still I was able to see the 4th row getting patched into my final data source

    Sidhant_02_1-1702362221212.png


    Is there anything that I am doing wrong?.

    Regards,
    Sidhant

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard