cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tapesh
Post Prodigy
Post Prodigy

ID duplication

Hi All, 

 

 

I m trying to use the cutomerID filed in my power apps, which will generate the new Custom ID starting from 1, and then 2,3,4,5,,6,7 and so on......

 

the issue i have is, the ID is generated in oder of 1,2,3,4 but for every new user it again starts from 1, where as i want the number to be continued, such that if last number by user1 is 4, next number should be 5 when user2 is submitting the request, 

 

The formula on my Customer ID filed is:

 

OnDefault: 

 

If(Edit_Emp_Form.Mode = New, First(
   Sort(
      'Petty Cash',
      CustomerID,
      Descending
   )
)
.CustomerID+ 1, ApplicationRecordsGallery.Selected.CustomerID)

 

can anyone help me to get this? 

 

The other issue is can there be a formula which will display the records of all the users, and not only the one using the app, in power apps? as currently user when logs in he can only see records with his name, where as im the owner of the app, i can see all the details of every one. is it that i have to make people owner of the app. ?

 

Thanks 

10 REPLIES 10
WarrenBelz
Super User
Super User

Hi @Tapesh ,

Not entirely sure on this, but some brackets may help on the Default

If(
   Edit_Emp_Form.Mode = FormMode.New, 
   (
      First(
         Sort(
            'Petty Cash',
            CustomerID,
            Descending
         )
      ).CustomerID
   )+ 1, 
   ApplicationRecordsGallery.Selected.CustomerID
)

Also confirm your CustomerID field is numeric in your data source.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

mdevaney
Super User
Super User

@Tapesh 
It is definitely odd that your code is working for User1 and not User2.  Can User2 see the records created by User1 when they view the SharePoint list?  If not, you might need to change the SharePoint list permissions for User2 as shown below.

 

Untitled.png

 

---

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."  

Thats great let me give a try 

Will this also give them permission to use SP list? it means can they delete edit? 

 

which I don't want them to do.. @mdevaney  please let me know.  i only want user to update delete and edit from powerapps, and not from sharepoint. is that possible ?

@Tapesh 
No, the Setting I shared has nothing to do with what you are asking.  You can't prevent a user from directly editing a SharePoint list if its shared to a PowerApp they have access to.  All you can do is take steps to ensure they will not find it.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

@WarrenBelz  im sorry but the solution which suggested did not work, I feel that its default by Microsoft . is it?

@mdevaney 

 

I guess i have same settings on, 

 

but do you want me to click yes where I have said no for management access? Untitled.png

@Tapesh 

No, I did not give any suggestion beyond what is shown in my picture.

Thanks, but i guess that is not working for me, I guess it default settings my Microsoft is it?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,676)