# getUserClaim

The api allows user to set a claim value. This claim Value gets added when user gets logged in. It is used to identify users claim. For example, to check whether a user is someone who he claims to be or not. By using this function, we can get userClaim and make useful comparisons in our apps.

## Parameters

1. claimName - This is the only paramter this function takes. It is the claiName which should be in the form of string.. App allows user to add claim name with or with out "claim\_" prefix.

## Example

```
Let suppose we have a claimName parameter "EFitDealer" then Gebra Suite will consider both "EFitDealer" and "claim_EFitDealer" as same.
```

## Example Usages

We can use "getUserClaim" function to get user's claim, a way to check user identity. As a parameter, we need to provide the claimName to this function. We can provide only the claimName or the claimName plus "claim\_" as prefix. Lets see both of them in action. We have a claimName "EfitDealerNumber", now we want to get userClaim:

Lets first do it without prefix "claim\_".

```javascript
let dealerNumber = app.getUserClaim("EfitDealerNumber");
console.log("The dealer Number is: " + dealerNumber);
```

It is ame as the previous example but now we use prefix.

```javascript
let dealerNumber = app.getUserClaim("claim_EfitDealerNumber");
console.log("The dealer Number is: " + dealerNumber);
```

An important thing to notice here is that it is required by Gebra Suite that for using SQL Parameters for claims must have to start with the "claim\_" prefix.

For example, Userclaims can also be used as SQL parameters:

```sql
   select @claim_EfitDealerNumber
```

### Return Values

The getUserClaim function returns the value of a user claim with the specified claimName.
