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 / how to create new form...
Power Apps
Answered

how to create new form if sharepoint list is empty

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

how to create a new form if a user selects a row in the power BI table visual and there is no entry for that row, this is my current formula that displays the form if there is a SharePoint list entry for the row - LookUp('Sales', Text(ID) = First(PowerBIIntegration.Data).Index) . *ID is the index column of my SharePoint list

 

I have asked chatGPT and it has provided the following formula, but the power app has errors - 'If' function has invalid arguments, 'NewForm' and 'EditForm' are not showing as valid functions in the formula. I have no idea why? 

 

If (isEmpty(First (PowerBIIntegration.Data).Index), NewForm(Form), EditForm (LookUp ('Sales', Text (ID) = First (PowerBIIntegration.Data).Index)))
 
even when I shorten the formula to - If(IsEmpty('Sales') - there are still invalid arguments for 'If'. Any advice?
Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Anonymous Are you having the If(.....) code in the Item property of the Form?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    yes, the item property is where the formula is located.

  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Anonymous That won't work.

    In the Item property of the Form set this,

    LookUp('Sales', Text(ID) = First(PowerBIIntegration.Data).Index)

    In the DefaultMode property set this,

    If(IsBlank(LookUp('Sales', Text(ID) = First(PowerBIIntegration.Data).Index)),
     FormMode.New,
     FormMode.Edit
    )

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard