Filter a record based on user condition

Hi! I have developed a site and I want it to be filtered for each user based on its condition (supplier name). Basically, my idea is to use the site as a "Supplier Portal", so each supplier can only see its own Purchase orders and invoices. To be clear, I want this:

- User 1 is the supplier 1 in real life. I want Appian to know that he is Supplier 1, and filter the records with this condition (in the record it would be nomProveedor = Supplier1)

I have thought about the options but I would want your expertise and advice:

1) Create a record type (username - supplier), and use this information to filter the record (I have doubts on the steps to achieve the supplier field based on the username and how to put it into a filter/query. 

2) Create a previous interface in which the user identifies himself with the supplier name (F.e. supplier 1) , and use this variable to filter

3) Create a group for each supplier and give permissions (it would be fine for 3 or 4 suppliers, but not viable for a lot of suppliers)

Any help would be useful!  Thank you so much

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi,

    The third option is definitely not !!

     You can create a record using the CDT you use for Purchase orders and invoices (If these are two different entities add a relationship in the record). and In the Source filters add a filter condition like nomProveedor = loggedinuser.

     

  • That sounds good! Do you mean to use the filter into the interface or at the Record Level Security?

    Also, the nomProveedor is filled by the user (dropdown, 4 choices, I obtained the values pointing a constant with the list of supplier names).

    I have no problem with the rest of fields, but If I put a filter like nomProveedor= "Proveedor 1", it doesnt work properly. When I use a filter of a field that is filled via dropdown it doesnt work unless I put nomProveedor= cons!(name)[numberOfRow]

    Do I have to put the dropdown values directly as a text instead of a constant?

  • 0
    Certified Senior Developer
    in reply to carlosp5114

    I am a bit confused here about which field needs to be exactly filtered based on the user who logs in. And also it should be configured at the Record level if it needs to be applied when the user logs in.

  • I´m going to create an user called "Proveedor 1", and I want for him a security rule to see only the record fields in which nomProveedor = Proveedor 1 (in this case, as you said, loggeduserin())

    But my problem here is that the value of the database is a dropdown value filled in an interface. And I don´t know why, but I´m not able to make a simple text filter work on it correctly.

    Maybe the fact that the choice values are a "List of Any type" has something to be

    Here I show you an interface which has a read-only grid of the mentioned Record. When I try to make a simple filter (only to this interface) the following error appears:

    How can I fix it, in order to make a text filter to a dropdown list which has text values inside?

Reply
  • I´m going to create an user called "Proveedor 1", and I want for him a security rule to see only the record fields in which nomProveedor = Proveedor 1 (in this case, as you said, loggeduserin())

    But my problem here is that the value of the database is a dropdown value filled in an interface. And I don´t know why, but I´m not able to make a simple text filter work on it correctly.

    Maybe the fact that the choice values are a "List of Any type" has something to be

    Here I show you an interface which has a read-only grid of the mentioned Record. When I try to make a simple filter (only to this interface) the following error appears:

    How can I fix it, in order to make a text filter to a dropdown list which has text values inside?

Children