Events.Sources
--------------

Returns an unordered list of source IDs.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Events](component_Events.md) | [6.2](newinversion62.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "Events.Sources" { ; AsJSON } ) 

**MBS**( **"Events.Sources";** /\* Returns an unordered list of source IDs. \*/  
**$AsJSON**) /\* Optional; Pass 1 to return result as JSON. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| AsJSON | Pass 1 to return result as JSON. |  | Optional      Added in version **13.4**. |

### Result

Returns list or error.

### Description

Returns an unordered list of source IDs.  
### Examples

Query list of sources:

 MBS ( "Events.Sources" )  
<small>  
Example result:   
56001  
56002  
56003  
56004</small>Queries sources and types:

 While(   
\[   
 names = "";   
 // query list of event sources IDs  
 list = MBS ( "Events.Sources" );   
 count = ValueCount(list);   
 index = 1  
\] ;   
 index ≤ count ;   
\[   
 id = GetValue(list; index);   
 // query name for each ID  
 name = MBS ( "[Events.Source.Title](EventsSourceTitle.md)"; id);   
 type = MBS ( "[Events.Source.Type](EventsSourceType.md)"; id);   
 names = names &amp; name &amp; " -&gt; " &amp; type &amp; ¶;   
 index = index + 1   
\] ;   
// return all the names  
names )  
<small>  
Example result:   
Auf meinem Mac -&gt; Local  
Andere -&gt; Birthdays  
Andere -&gt; Subscribed  
Mac.com -&gt; CalDAV  
Mac.com -&gt; CalDAV</small>Query as JSON:

 MBS ( "Events.Sources"; 1 )  
<small>  
Example result:   
\[ { "sourceTypeText" : "CalDAV" , "title" : "Mac.com" , "sourceIdentifier" : "68B72E23-6DC9-47EC-9C29-D844DB9F77BD" , "isDelegate" : false, "sourceType" : 2 }, { "sourceTypeText" : "Subscribed" , "title" : "Subscribed Calendars" , "sourceIdentifier" : "B52BAF80-5415-406B-8F86-EB990F30AF86" , "isDelegate" : false, "sourceType" : 4 }, { "sourceTypeText" : "Birthdays" , "title" : "Other" , "sourceIdentifier" : "\_\_\_\_\_\_NativeStorePersistentID\_\_\_\_\_\_\_" , "isDelegate" : false, "sourceType" : 5 }, { "sourceTypeText" : "CalDAV" , "title" : "Mac.com" , "sourceIdentifier" : "780DE199-35C3-4720-9FF0-D5CB37A4B7E6" , "isDelegate" : false, "sourceType" : 2 } \] </small>### See also

- [Events.Calendar.GetSource](EventsCalendarGetSource.md)
- [Events.Calendar.SetSource](EventsCalendarSetSource.md)
- [Events.Source.Title](EventsSourceTitle.md)
- [Events.Source.Type](EventsSourceType.md)

### Release notes

- **Version 13.4**
    - Added AsJSON parameters to [Events.Calendars](https://www.mbsplugins.eu/EventsCalendars.shtml), [Events.Source.Calendars](https://www.mbsplugins.eu/EventsSourceCalendars.shtml), [Events.Item.GetCalendar](https://www.mbsplugins.eu/EventsItemGetCalendar.shtml), [Events.defaultCalendarForNewEvents](https://www.mbsplugins.eu/EventsdefaultCalendarForNewEvents.shtml), [Events.defaultCalendarForNewReminders](https://www.mbsplugins.eu/EventsdefaultCalendarForNewReminders.shtml), [Events.SourceWithType](https://www.mbsplugins.eu/EventsSourceWithType.shtml), [Events.Sources](https://www.mbsplugins.eu/EventsSources.shtml) and [Events.DelegateSources](https://www.mbsplugins.eu/EventsDelegateSources.shtml) functions to return result as JSON.

### Blog Entries

- [MBS FileMaker Plugin, version 13.4pr1](https://www.mbsplugins.de/archive/2023-08-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 10th March 2016 , last changed 20th July 2023

  
[Events.SourceWithType](EventsSourceWithType.md) - [Events.StructuredLocation.Copy](EventsStructuredLocationCopy.md)

[HTML Version](EventsSources.shtml)