I want to create a list of cdb_Users.
I want to use this list to select a user to update or delete.
I have looked at the user api's and can't find the api that would let me create such a list.
Can I do this via a query and can you give an example script?
Can you clarify how you are using this list to update or delete a user?
07-18-2019, 03:42 PM
(This post was last modified: 07-18-2019, 04:17 PM by clarencemartin.)
I think that I have figured part of this out. I didn't understand about using the cdb_userTable to get the CDBUsersTable id. for the query.
the following script yields: only user recordID's
on mouseUp pButtonNumber
local tInputA, tOutputA, tUsers
put cdb_userTableName() into tUsers
put cdb_query("email","~","*.com",tUsers,"cloud","recordList") into tOutputA
answer tOutputA
end mouseUp
OK, I changed the "recordList" to "RecordData" and I see all of the Array data.
Jason,
creating a list of users will allow an Administrator to pick a user from a list that he/she wants to delete.
Deleting a user with the LCM is easy, but an administrator may want to delete a particular user via the application and having a list of users is the way to do this.
I am actually changing the following line in the script" to:
put cdb_query("email","~","*.*",tUsers,"cloud","recordList") into tOutputA.
the reason : there may be emails that are ".com", ".net" or any ".?" .
I think you can either do a batch read on all the records or just list the emails to choose from.
Doing this should give you all the data of the users table
local tInputA, tOutputA, tTableID
put cdb_userTableName() into tTableID
put empty into tInputA[tTableID]["*"]
put cdb_batchRead(tInputA,"cloud") into tOutputA
You can also use cdb_list to get a list of the emails and let the administrator choose from the emails.
local tTable, tTarget, tKeys, tOutputA
put cdb_userTableName() into tTable
put cdb_list(tTable,"cloud","email") into tOutputA
can you please test this script that you posted?
local tInputA, tOutputA, tTableID
put cdb_userTableName() into tTableID
put empty into tInputA[tTableID]["*"]
put cdb_batchRead(tInputA,"cloud") into tOutputA
I have been trying to make this work and this doesn't seem to work.