Show user only data overwrites the existing rows problem

Hi Appsheet Community 

I have an trouble with "user only data" I took a model from YouTube video by "Appsheet Training" (https://youtu.be/2Z2qUTtxNFA). When I finished the script having followed in accordance to the video, I received a situation when every new user have actually erased -overwrote the existing rows we already had. The same order table, but every new order had eliminated the old ones by overwriting them. 

Please help, otherwise the app will actually remain a single user app, not for company with multiple users.

Any help will do ))

 

 

 

1 12 238
12 REPLIES 12

Hi @Bagrat_Tsakadze,

Great question, and welcome to the community! Could you provide a few screenshots of the problem that's occurring? Might help me understand the data structure a little bit better and help with diagnosing the issue.

Thanks,

Austin from AppSheet Training

Hi @Austin_QREW 

Thanks for your feedback and thanks a lot for the amazing things QREW does on daily basis!

The problem relates to the ORDER - table that is actually the whole app as it is.  So the security filter for the Order - table looks like this:

 

 

IFS(

ANY(Current_User[Role]) = 'Superadmin', 

TRUE, 

ANY(Current_User[Role]) = 'Admin',

OR(

[Creator] = USEREMAIL(),

AND(

[Creator].[Filial] = ANY(Current_User[Filial]),

[Creator].[Role] = 'Sales Consultant'

)

),

  TRUE,

  [Creator] = USEREMAIL()

)

That is the script. I have some doubts with regards to Order ID formula, can it be the reason? 

Bagrat_Tsakadze_0-1651991938622.png

 

 

I am not sure which parts of the Order -table to show. Please let me have an idea

 

Hi @Bagrat_Tsakadze,

Thanks for the follow up messages and the kind words. The expression you are using looks correct.

Question: Is the data not showing in the Google Sheets Order Table or just not showing in the UX View of orders? 

If it is the first - yes the ORDER ID may be getting overwritten somehow by users depending on how you are referencing this record. 

If the data is in your Google Sheet you may just need to create a new view that uses slices of the ORDER Table data to show/hide certain records. 

Hope this helps let me know if you have any other questions, I will help in anyway I can. 

We also have free tech talks available if your interested in setting up some consulting time with our AppSheet Developers. You can sign up for your Tech Talk with @Cale_QREW here: https://calendly.com/cale-9/tech-talk 

Thanks,

Austin from AppSheet Training

Hi @Austin_QREW 

Thanks for your feedback, Appsheet support team is really doing great ๐Ÿ‘

As for the issue itself the script I have pasted above has been in action for a couple of days before I have found out that 2 more sales team members entered new orders successfully, though have erased the old ones. We lost the trace of them on Google Sheets, it is definitely not an issue of slices. 

How to correct it? That is why I can not make it workable for multi users. On the other side we had two users before that script, and both used to upload orders in a normal way. Though the script has changed the way it worked and I have completely erased it. 

Let me have an idea of how maintain the ORDER ID logic and make the app USER ONLY DATA RESTRICTED. 

 

Any help will be of great importance))

Hi @Bagrat_Tsakadze,

Thanks for the quick reply. I would need to see the data structure and columns of the app to help with this issue. 

Thanks,

Austin from AppSheet Training

Hi @Austin_QREW 

Let me have an idea of data you need to see, I will upload it. The order table is huge, around 200 columns, that's why I can't decide what to show. Herewith please find the ORDER ID expression:

 

Please see the INVOICE ID expression:

MAX(SELECT(Order[Invoice ID], [Document Type] = [_THISROW].[Document Type])) + 1

The Initial Value for the same field equals to: UNIQUEID()

 

 

 

Sorry I have not really looked through this thread in detail, however if [Invoice ID] has an initial value of UNIQUEID() then it will be an alphanumeric (so a text field). Your expression appears to be adding 1 to the max ID, but that would surely fail if the ID is text.

Hi Graham,

Thanks for coming back to me ))

I ve changed the Initial Value to an empty, as a result, there are no more overwrites, though it repeats the already existing Invoice ID-s. I mean that INVOICE ID field is not a KEY (I use a _ComputedKey KEY - [ CONCATENATE([ID order],": ",[INVOICE ID]) ])

The idea is to proceed with the existing INVOICE ID numbering without changing the basic algorithm. I wish to avoid any duplicate INVOICE IDs and keep the invoicing Unique for the whole company. At least each subsidiary should have one order, not the same repeated INVOICE IDS (in my case I have numbers only in an INVOICE ID).

Hope the sentences above are nor not messy ))

 

 

Top Labels in this Space