# \_setPortalVisibility

Sets whether a Form is visible via portal or not and if it can be picked.

### Parameters

#### id

The ID of the Form

#### val

An integer which decides if the Form is visible and if it can be picked:\
0 => Not visible, cannot be picked\
1 => Visible, cannot be picked\
2 => Not visible, can be picked\
3 => Visible, can be picked

### Example

```
FM_api('Form_setPortalVisibility',[
  'id'=>'460569',
  'val'=>'3'
]);
```

### Results

#### On Success

```
{"ok":1}
```

If the value of "val" is the same as before:

```
{"ok":1,"warning":"value already set"}
```

#### On Failure

If the "id" parameter is missing:

```
{"error":"no ID provided"}
```

If the "val" parameter is missing:

```
{"error":"no val provided"}
```

If the "id" parameter does not match an existing Form:

```
{"error":"form does not exist"}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/form/_setportalvisibility.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
