Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Ptaching activity check combobox is blank or slected any value

(0) ShareShare
ReportReport
Posted on by

Hello Everyone,

I'm new to PowerApps and have a form linked to a Sharepoint List.
I'm patching some data to a sharepoint list, and while I'm doing it, I'd want to see whether the combobox has a chosen item or if it's empty, and then I'd like to update the data in the sharepoint List column.


I can only complete the part when the Combobox is set to Data. However, I am unable to obtain the desired outcome if the combobox data is left blank. If somebody could assist me in this circumstance, it would be greatly appreciated.

 

Prathamesh2415_0-1699445184571.png

If(
IsBlank(ComboBox2.Selected),
{'Column Name': "Data not present"},
{'Column Name': "Data Present"}
)


PATCH CODE :

ForAll(ComboBox1.SelectedItems As ColCollection,ForAll(ComboBox2.SelectedItems As B,ForAll(ComboBox3.SelectedItems As C,
Patch(PowerAppList,
Defaults(PowerAppList),
{Title: "Mr"},
{abc: Name.Text},
{Country: ColCollection.COMPANY},
{System: B.SYSTEM},
{'App Requested': C.'App requested'},
If(
IsBlank(ComboBox2.Selected),
{'A': "Data not present"},
{'B': "Data Present"}
)
)
)
)
);

  • Re: Ptaching activity check combobox is blank or slected any value

    ForAll(
    ComboBox1.SelectedItems As A,
    ForAll(
    ComboBox2.SelectedItems As B,
    ForAll(
    ComboBox3.SelectedItems As C,
    If(
    IsBlank(ComboBox2.Selected),
    Patch(
    PowerAppList,
    Defaults(PowerAppList),
    {Title: "Mr"},
    {abc: Name.Text},
    {Country: A.COMPANY},
    {'App Requested': C.'App requested'},
    {'Last name': "Data not Present"}
    ),
    Patch(
    PowerAppList,
    Defaults(PowerAppList),
    {Title: "Mr"},
    {abc: Name.Text},
    {Country: A.COMPANY},
    {System: B.SYSTEM},
    {'App Requested': C.'App requested'},
    {'Last name': "Data Present"}
    )
    );
    )
    )
    );

  • Re: Ptaching activity check combobox is blank or slected any value

    Hello @Shaheer I tried this approach as well but with this approach it didn't patch any data to Sharepoint List and none of the entries are filled with data

  • Shaheer Ahmad Profile Picture
    Shaheer Ahmad 2,194 on at
    Re: Ptaching activity check combobox is blank or slected any value

    Try using ComboBox2.SelectedItems instead of ComboBox2.Selected. Also, since you are using ForAll for ComboBox2, you need to check if all selected items are blank. Here's an updated version of your code:

     

    ForAll(
     ComboBox1.SelectedItems As ColCollection,
     ForAll(
     ComboBox2.SelectedItems As B,
     ForAll(
     ComboBox3.SelectedItems As C,
     Patch(
     PowerAppList,
     Defaults(PowerAppList),
     {Title: "Mr"},
     {abc: Name.Text},
     {Country: ColCollection.COMPANY},
     {System: B.SYSTEM},
     {'App Requested': C.'App requested'},
     If(
     IsBlank(ComboBox2.SelectedItems),
     {'A': "Data not present"},
     {'B': "Data Present"}
     )
     )
     )
     )
    )

     

    This change should check if all selected items in ComboBox2 are blank and then handle the PATCH accordingly. Give it a try, and let me know if it works for you!

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,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard